﻿// Account.cs
using System.Security.Principal;

[DisplayName("帐号管理模块")]
public class Account : EntityBase
{
    [Required]
    [Key]
    [MaxLength(50)]
    [DisplayName("帐号ID")]
    public string AccountId { get; set; }

    [Required]
    [MaxLength(50)]
    [DisplayName("平台ID")]
    public string PlatformId { get; set; }

    [Required]
    [MaxLength(100)]
    [DisplayName("帐号名称")]
    public string AccountName { get; set; }

    [MaxLength(255)]
    [DisplayName("帐号显示名称")]
    public string DisplayName { get; set; }


    [DisplayName("帐号Token")]
    public string AccessToken { get; set; }


    [DisplayName("刷新Token")]
    public string RefreshToken { get; set; }


    [DisplayName("Token失效时间")]
    public DateTime? TokenExpiry { get; set; }


    [DisplayName("配置文件")]
    public string Profile { get; set; }


    [DisplayName("状态")]
    public string Stats { get; set; }

    [Required]
    [DisplayName("帐号状态")]
    public AccountStatus Status { get; set; } = AccountStatus.Active;

    [Required]
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;

    [DisplayName("最后同步时间")]
    public DateTime? LastSyncedAt { get; set; }

    //// 导航属性
    //[ForeignKey("PlatformId")]
    //public virtual Platform Platform { get; set; }
}

public enum AccountStatus
{
    Active = 1,
    Disabled = 0,
    TokenExpired = 2,
    Limited = 3
}